<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCaseContractsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('case_contracts', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title')->default('');
            $table->integer('case_customer_id');
            $table->json('fields')->nullable()->comment('自定义字段');
            $table->date('signdate')->comment('签署日期');
            $table->date('expiretime')->comment('到期时间');
            $table->decimal('total')->comment('合同总额');
            $table->decimal('salesexpenses')->nullable()->comment('支出');
            $table->string('remark')->nullable()->comment('备注');
            $table->json('compliance')->nullable()->comment('履约步骤');
            $table->integer('nodes')->nullable()->comment('节点');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('case_contracts');
    }
}
